package cn.sdormitory.smartclass.service.impl;

import cn.sdormitory.smartclass.dao.ClassHygieneDao;
import cn.sdormitory.smartclass.entity.ClassHygiene;
import cn.sdormitory.smartclass.service.ClassHygieneService;
import cn.sdormitory.smartclass.vo.ClassHygieneVo;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * @创建人：zhouyang
 * @创建时间：2021/12/21 22:52
 * @version：V1.0
 */
@Slf4j
@Service("classHygieneServiceImpl")
public class ClassHygieneServiceImpl extends ServiceImpl<ClassHygieneDao, ClassHygiene> implements ClassHygieneService {
    @Override
    public ClassHygieneVo getClassHygieneInfo(Long classId, String checkDate, String timeSlot) {
        return this.baseMapper.getClassHygieneInfo(classId,checkDate,timeSlot);
    }

    @Override
    public int create(ClassHygiene classHygiene) {
        return this.baseMapper.insert(classHygiene);
    }

    @Override
    public int update(ClassHygiene classHygiene) {
        classHygiene.setModifyTime(new Date());
        return this.baseMapper.updateById(classHygiene);
    }
}
